package cn.autumnorange.app.snowflake.api;

import cn.autumnorange.app.common.dto.ResultDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * @author wsf
 * @time
 */
@FeignClient(value = "app-snowFlake-provider", fallbackFactory = SnowFlakeFallbackFactory.class)
public interface SnowFlakeService {
  @GetMapping(value = "getGlobalId")
  ResponseEntity<ResultDto<Long>> getGlobalId();

  @GetMapping("/test")
  @PreAuthorize("hasRole('ROLE_admin')")
  ResponseEntity<ResultDto> test(HttpServletRequest request);
}
